// 基础路径 注意发布之前要先修改这里
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
  publicPath: process.env.VUE_APP_BASE_URL,
  lintOnSave: true,
  productionSourceMap: false,
  configureWebpack: (config) => {
    if (process.env.NODE_ENV === "production") {
      return {
        plugins: [
          // new BundleAnalyzerPlugin()
        ],
      };
    }
  },
  devServer: {
    host: "0.0.0.0",
    open: true,
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: `http://192.168.6.144:9090`,
        // target: `http://127.0.0.1:8080`,
        // target: `http://10.1.90.252:8001`,
        // target: `http://10.1.90.252:8002`,
        // target: `http://10.1.90.252:8003`,
        // target: `http://10.1.71.252:8080`,
        // target: `http://10.1.71.252:8080`,
        // yb05
        // target: `http://10.1.74.252:8080`,
        //  yb06
        changeOrigin: true,
        pathRewrite: {
          ["^" + process.env.VUE_APP_BASE_API]: "",
        },
      },
    },
    disableHostCheck: true,
  },
  chainWebpack: (config) => {
    const entry = config.entry("app");
    entry.add("babel-polyfill").end();
    entry.add("classlist-polyfill").end();
    entry.add("@/mock").end();
  },
  css: {
    extract: { ignoreOrder: true },
  },
};
